5

5

DOI: 10.1201/9781003214335-2

What Is an Algorithm?

Algorithm is a word used in computer science. It simply means a step-​by-​step instruc­

tion. But it encapsulates the essence of computer programming, because without a

step-​by-​step instruction a computer cannot perform a useful task. Therefore, it means

much more than that.

The word algorithm has the same root as the word Algebra. With an Arab past, it

came from ninth-​century Persian mathematician Muammad ibn Mūsā al-​Khwārizmī.

Al-​Khwārizmī (Arabic: الخوارزمی, c. 780–​850) was a Persian mathematician, astron­

omer, geographer, and scholar whose name means “the native of Khwarazm”, a

region that was part of Greater Iran and is now in Uzbekistan.

About 825 ad, al-​Khwarizmi wrote an Arabic language treatise on the Hindu–​

Arabic numeral system, which was translated into Latin during the 12th century under

the title Algoritmi de numero Indorum. This title means “Algoritmi on the numbers of

the Indians”, where “Algoritmi” was the translator’s Latinization of al-​Khwarizmi’s

name. The modern sense of this word was introduced in the 19th century. By the way,

al-​Khwarizmi was the most widely read mathematician in Europe in the late Middle

Ages, primarily through another of his books, the Algebra.

Algorithms are part of our understanding of life and is used by all fields and dis­

ciplines to convey a process. Some are small and famous. Like the book “Eat, Love,

Pray”. Or the recent hotel/​restaurant ad: “Eat, Drink, Sleep, Repeat”. Some are long

and detailed, such as a recipe.

In the computer world, an algorithm is used to code the program, hence needs to

be somewhat detailed. But the role of the algorithm is to facilitate the creation of the

program—​just like a recipe. Once the chocolate chip cookie is made, the recipe is not

useful, until you are ready to make the next batch!

The discussion on algorithms is not complete without the concept of some

important attributes . A good algorithm needs to be:

• Accurate

• Repeatable

• Concise

• Optimized

1